|
The unary numeral system is the bijective base-1 numeral system. It is the simplest numeral system to represent natural numbers:〔.〕 in order to represent a number ''N'', an arbitrarily chosen symbol representing 1 is repeated ''N'' times.〔.〕 For examples, the numbers 1, 2, 3, 4, 5, ... would be represented in this system as〔.〕 :1, 11, 111, 1111, 11111, ... These numbers should be distinguished from repunits, which are also written as sequences of ones but have their usual decimal numerical interpretation. This system is used in tallying. For example, using the tally mark |, the number 3 is represented as |||. In East Asian cultures, the number three is represented as “三”, a character that is drawn with three strokes.〔.〕 ==Operations== Addition and subtraction are particularly simple in the unary system, as they involve little more than string concatenation.〔. See in particular p. 48.〕 The Hamming weight or population count operation that counts the number of nonzero bits in a sequence of binary values may also be interpreted as a conversion from unary to binary numbers.〔.〕 Multiplication is more cumbersome, however, and has often been used as a test case for the design of Turing machines.〔.〕〔.〕〔.〕 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Unary numeral system」の詳細全文を読む スポンサード リンク
|